<?php
namespace app\http;

use think\worker\Server;
use think\Db;
class Worker extends Server
{

    protected $protocol    = 'tcp'; // 协议 支持 tcp udp unix http websocket text
    protected $host       = '0.0.0.0'; // 监听地址
    protected $port     = 2347; // 监听端口

    protected $name = 'thinkphp';
    protected $count      = 1;
	protected $lian=[];
	public function onConnect($connection)
	{
		//dump($connection);
	}
	public function onMessage($connection,$data)
	{
		$connection->send('99');
		dump($data);
	}
	public function onClose($connection)
	{
		
	}
	public function onError($connection, $code, $msg) 
	{
        echo "error [ $code ] $msg\n";
    }
}

